<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>打印数字</title>
    <script>
      function print1() {
        let start = 1,
          base = 8
        for (let i = 1; i <= 9; i++) {
          document.write(`${start} * ${base} + ${i} = ${start * base + i}<br/>`)
          start *= 10
          start += i + 1
        }
      }

      function print2() {
        let start = 1,
          base = 9
        for (let i = 2; i <= 10; i++) {
          document.write(`${start} * ${base} + ${i} = ${start * base + i}<br/>`)
          start *= 10
          start += i
        }
      }

      function print3() {
        let start = 9,
          base = 9
        for (let i = 7; i >= 1; i--) {
          document.write(`${start} * ${base} + ${i} = ${start * base + i}<br/>`)
          start *= 10
          start += i + 1
        }
      }

      print1()
      print2()
      print3()
    </script>
  </head>
  <body></body>
</html>
